#include <iostream>
#include <opencv2/opencv.hpp>
#include "QuickDemo.h"
using namespace cv;
using namespace std;
void demo(){
    //图像矩阵
    Mat src = imread("../img/demo.jpg", IMREAD_GRAYSCALE);
    if(src.empty()){
        cout << "could not load img" << endl;
        return;
    }
    String winName = "hello";
    //创建一个窗口，
    namedWindow(winName, WINDOW_FREERATIO);
    //使用创建的窗口显示图像数据
    imshow(winName, src);

    waitKey(0);
    destroyAllWindows();
}
void demo2(){
    //图像矩阵
    String imgPath = "../img/demo1.jpg";
    Mat src = imread(imgPath);
    if(src.empty()){
        cout << "could not load img:" << imgPath << endl;
        return;
    }
    waitKey(0);
    destroyAllWindows();
    QuickDemo quickDemo;
    // quickDemo.colorSpaceDemo(src); //色彩空间
    //quickDemo.matCreationDemo(src); //mat的创建
    //quickDemo.pixelVisitDemo(src); //像素读写
    //quickDemo.pixelOperate(src); //像素操作
    //quickDemo.trackBarDemo(src); //拖动bar调整亮度对比度
    //quickDemo.colorStyle(src); // 颜色风格
    //quickDemo.bitWiseDemo(src);
    //quickDemo.channelsDemo(src);
    //quickDemo.inRangeDemo(src);
    // quickDemo.pixelStatistic(src); //像素统计
    //quickDemo.drawDemo(src); //绘制
    //quickDemo.randomDraw(src); //随机绘制
    //quickDemo.drawPolygon(src); //多边形绘制
    //quickDemo.normalizedDemo(src);  //归一化
    //quickDemo.resizeDemo(src);//缩放
    //quickDemo.flipDemo(src);//翻转
    //quickDemo.rotateDemo(src);
    //quickDemo.videoDemo(src); //摄像头，视频
    quickDemo.showHistogram(src);
    waitKey(0);
    destroyAllWindows();
}

int main() {
    demo2();
    return 0;
}
